package com.seezoon.infrastructure.tcp.jt808;

import com.seezoon.infrastructure.tcp.common.Encoding;
import com.seezoon.infrastructure.tcp.common.MessageField;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @see com.seezoon.infrastructure.tcp.codec.JT808#终端注册应答
 */
@Getter
@Setter
@ToString
public class JT8100 {

    @MessageField(desc = "应答流水号")
    private int responseMsgSerialNo;

    @MessageField(desc = "结果")
    private int resultCode;

    @MessageField(desc = "鉴权码(成功后才有该字段)", encoding = Encoding.GBK)
    private String token;

    public static class ResultCode {

        /**
         * 0.成功
         */
        public static final int Success = 0;
        /**
         * 1.车辆已被注册
         */
        public static final int AlreadyRegisteredVehicle = 1;
        /**
         * 2.数据库中无该车辆
         */
        public static final int NotFoundVehicle = 2;
        /**
         * 3.终端已被注册
         */
        public static final int AlreadyRegisteredTerminal = 3;
        /**
         * 4.数据库中无该终端
         */
        public static final int NotFoundTerminal = 4;
    }
}